/*
 * UDPClient.hpp
 *
 *  Created on: Dec 29, 2014
 *      Author: toti
 */

#ifndef UDPCLIENT_HPP_
#define UDPCLIENT_HPP_

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <string.h>

#include <string>
#include <sstream>

class UDPClient{

private:

	std::string address;
	std::string port;

	int sock;
	struct addrinfo sainfo, *psinfo;



public:

	UDPClient(std::string &address, std::string &port);

	void initMulticast();
	void initUnicast();

	int sendDatagram(size_t len, void *data);

};


#endif /* UDPCLIENT_HPP_ */
